<template>
  <div class="table">
    <table class="table-show" border="1">
      <tr>
        <th :colspan="data.length + 1">{{title}}</th>
      </tr>
      <tr v-for="(item,index) in data" :key="index">
        <td>{{item.tag}}</td>
        <td v-for="(itm,ind) in item.data" :key="ind">{{itm}}</td>
      </tr>
    </table>
  </div>
</template>

<script>
  export default {
    props: ["data","title"]
  }
</script>

<style lang="less">
  .table {
    height: 80%;
    overflow: auto;
     .table-show {
      margin-top: 5px;
      width: 100%;
      border-collapse: collapse;
      color: white;
      border: 1px solid white;
      td {
        text-align: center;
        &:first-child {
          width: 26%;
        }
      }
      td,th {
        padding: 5px 0;
      }
    }
  }

</style>
